﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Reflector.CodeModel;
using Reflector.Graph.Graphs;

namespace MethodSeqGenerator
{
    class SeqGenStatementGraphEdgePopulatorVisitor : StatementGraphEdgePopulatorVisitor
    {
        StatementGraph graph = null;


        public SeqGenStatementGraphEdgePopulatorVisitor(StatementGraph graph) : base(graph)
        {
            this.graph = graph;
        }

        IStatement currentStatement = null;
        public override void VisitStatement(IStatement value)
        {
            currentStatement = value;
            base.VisitStatement(value);
        }

        public override void VisitMethodInvokeExpression(IMethodInvokeExpression value)
        {
            MethodInvocationHolder mihObj = SeqGenerator.methodNodes[value] as MethodInvocationHolder;
            StatementVertex gpVertex = this.graph.GetVertex(mihObj);
            if (gpVertex != null)
            {

            }            
            base.VisitMethodInvokeExpression(value);
        }

        public override void VisitObjectCreateExpression(IObjectCreateExpression value)
        {
            MethodInvocationHolder mihObj = SeqGenerator.methodNodes[value] as MethodInvocationHolder;
            StatementVertex gpVertex = this.graph.GetVertex(mihObj);
            if (gpVertex != null)
            {

            }
            base.VisitObjectCreateExpression(value);
        }
    }
}
